package com.wnxy.dto;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

@Data
public class ManagerDetail implements UserDetails {

    private static final long serialVersionUID = 1L;

    private Integer managerId;
    private String managerName;
    private String managerPassword;
    private String managerLogintime;
    private Integer managerStatus;
    private String managerPhone;
    private String managerImg;
    private String managerQqName;
    private String openId;
    private String managerRegtime;
    private Integer mangerRoleId;
    private  Collection<? extends GrantedAuthority> authorities;

    public void setAuthorities(Collection<? extends GrantedAuthority> authorities) {
        this.authorities = authorities;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }
    @Override
    public String getPassword() {
        return managerPassword;
    }
    @Override
    public String getUsername() {
        return managerName;
    }
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }
    @Override
    public boolean isAccountNonLocked() {
        return true;
    }
    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }
    @Override
    public boolean isEnabled() {
        return true;
    }
}
